const Sequelize = require('sequelize'); //引入Sequelize模块
const db = require('../db');

//定义model
const Admin = db.define('Admin', {
    //主键
    id: { type: Sequelize.INTEGER, primaryKey: true, allowNull: false, autoIncrement: true },
    //用户名
    username:{type:Sequelize.STRING(25)},
    //密码
    password:{type:Sequelize.STRING(100)},
    //昵称
    name:{type:Sequelize.STRING(16)},
    //创建时间
    created_at: { type: Sequelize.DATE },
    //修改时间
    updated_at: { type: Sequelize.DATE },

}, {
    underscored: true,
    tableName: 'admin',
    //timestamps: false//禁用创建时间戳
});

module.exports = Admin;